<!DOCTYPE html>
<html>
<head>
    <title>form组件支持验证</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <script src="../../avalon.js"></script>
    <script>
        avalon.library("aoyou", {
            $ready: function () {
                avalon.log("控件已经构建完毕")
            }
        })
        require(["./component/form/avalon.form","./component/textbox/avalon.textbox","./component/button/avalon.button"], function () {
            var vm = avalon.define({
                $id: "test",
                sss1:"",
                sss2:"",
                sss3:"",
                _takedata:function(){
                    var formcomp = avalon.vmodels['ex-form'];
                    console.log(formcomp.getData())
                },
                $opt:{
                    submitCallback: function(ev, vm, data) {
					    alert(0)
				    }
                }
            })
            avalon.scan()
        })
    </script>
</head>
<body>
<div ms-controller="test">
    <div>用户注册</div>
    <br>
    <div>
        {{sss1}}---{{sss2}}---{{sss3}}
    </div>
    <aoyou:form $id="ex-form" config="$opt">
        <div slot="formcontent">
            <div>
                <br>
                <aoyou:textbox value="sss1" validation="req,int"></aoyou:textbox>
            </div>
            <div>
                <br>
                <aoyou:textbox value="sss2" validation="int"></aoyou:textbox>
            </div>
            <div>
                <br>
                <aoyou:textbox value="sss3" validation="req,int"></aoyou:textbox>
            </div>
            <div class="row">
                <br>
                <aoyou:button color="success" ms-click="_doSubmit($event)">提交</aoyou:button>
                <aoyou:button  ms-click="_doReset($event)">重置</aoyou:button>
                <aoyou:button  ms-click="_takedata()">获取数据</aoyou:button>
            </div>
        </div>
    </aoyou:form>
</div>
</body>
</html>
